<?php

/**
 * Deleting a ProRole
 * @package ModuleOrganisationCommunication
 * @version 1.0b
 * @var $_POST['id'] The prorol's ID
 */


session_start();

// Configuration file
include '../configuration.php';
// Functions
include '../inc/functions.php';

// Checking if user is logged in
if (!CheckSession()):
	exit();
endif;

// Include all objects
// TODO: Include only needed classes
foreach (glob($configuration['webroot'].'objects/*.php') as $class) { include_once $class; }

try {
	// Retrieving prorole
	$prorole = new Prorole();
	$prorole->Get($_POST['id']);
	
	// Deleting prorole from Database
	$prorole->Delete();
	
	echo 'OK';

} catch (Exception $e) {
	echo $e->getMessage();
}
?>